<template>
  <nav class="top-navigation">
    <div class="smark-title">Smark账本管理系统-管理员后台</div>
    <div class="welcome-message">欢迎！管理员 {{ adminName }}</div>
    <button @click="logout" class="logout-button">退出登录</button>
  </nav>
</template>

<script setup>
/* global defineProps, defineEmits */
defineProps({
  adminName: {
    type: String,
    required: true
  }
});

const emit = defineEmits(['logout']);

const logout = () => {
  emit('logout');
};
</script>

<style scoped>
.top-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #42b983;
  padding: 0 20px;
  height: 60px;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-button {
  background-color: transparent;
  border: 1px solid white;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.logout-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
</style>